home *** CD-ROM | disk | FTP | other *** search
- /* tmpfile.c --- p 469 */
- #include <stdio.h>
- char message[80] = "Testing tmpfile.... ";
- main()
- {
- FILE *tfile;
- if ((tfile = tmpfile()) == NULL)
- perror("tmpfile failed");
- else
- {
- printf("Temporary file successfully opened.\n");
- printf("Wrote %d characters to file\n",
- fwrite((void *)message, sizeof(char), 80, tfile));
- printf("File will be gone when you exit.\n");
- }
- }